<template>
    <div class="swiper">
     <swiper :options="swiperOption">
        <swiper-slide v-for="item in swiperList" :key="item.id">
            <img class="swiper-img" :src="item.imgUrl" alt="">
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
     </swiper>
    </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  data () {
    return {
      swiperOption: {
        pagination: {
          el: '.swiper-pagination',
          loop: true
        },
        autoplay: true
      },
      swiperList: [
        { id: '001', imgUrl: 'https://aecpm.alicdn.com/simba/img/TB14ab1KpXXXXclXFXXSutbFXXX.jpg_q50.jpg' },
        { id: '002', imgUrl: 'https://aecpm.alicdn.com/simba/img/TB1CWf9KpXXXXbuXpXXSutbFXXX.jpg_q50.jpg' },
        { id: '003', imgUrl: 'https://gw.alicdn.com/tfs/TB1zWn8AHH1gK0jSZFwXXc7aXXa-1125-352.jpg' },
        { id: '004', imgUrl: 'https://gw.alicdn.com/tfs/TB1jPv8ANv1gK0jSZFFXXb0sXXa-1125-352.jpg' }
      ]
    }
  }
}
</script>

<style lang="less" scoped>
.swiper/deep/.swiper-pagination-bullet-active{
  background-color:#fff;
}
.swiper{
    overflow: hidden;
    background-color: #ccc;
    .swiper-img{
        width: 100%;
    }
}
</style>>
